package com.srcptit.java.training.kienbd.btvn1;

import java.util.Scanner;

public class Muc1Bai6STN {
	/*
        static boolean Sothuannghich(String str){
            String str1 = str;
            if( str.equals(str1)==true ){
                return true; 
            }
            return false;
	}*/
        static boolean Sothuannghich(int n){//Kiem tra so thuan nghich hay ko?
            int sodao = 0;
            int m = n;
            while(m>0) {
                sodao = sodao*10 + m%10;
                m = m/10;
            }
            if( sodao==n )  return true;
            return false;
        }
	public static void main(String args[]){//Loc va in so thuan nghich.
            System.out.println("Tat ca cac so thuan nghich 7 chu so :");
            int dem = 0;
            for(int i=1000000; i<=9999999; i++){
                if( Sothuannghich(i)==true ){
                    System.out.println(i);
                    dem++;
                }
            }System.out.println("Co "+dem+" so.");
        }
    }
            /*
            Scanner input = new Scanner(System.in);
            int n = input.nextInt();
            String str = String.valueOf(n);
            if( Sothuannghich(str)==true )
                System.out.println("YES");
            else
                System.out.println("No");*/
    
